<%@page import="java.sql.*" %>

<%@ page import="com.hline.kbcss.MyDriver"%>

<%
String uname=request.getParameter("uname");
String password=request.getParameter("pswd");

ResultSet rs3=null;
Statement stmt3=null;
Statement stmt4=null;
try{
stmt3=MyDriver.getConnection("READ");
	String str3="SELECT * FROM hr where uname='"+uname+"' and pswd='"+password+"' " ;
rs3=stmt3.executeQuery(str3);

	if(rs3.next())
	{
      if(rs3.getInt("abuse")>=4)
	   {
	    response.sendRedirect("enable.jsp?id="+rs3.getInt("userid")+"&status=delete&rpage=rlogin.jsp");
	   }	
		String username=rs3.getString("uname");
System.out.println("user name is"+username);
		int uid1=rs3.getInt("userid");
		String uid=""+uid1;
		session.setAttribute("uname",username);
		session.setAttribute("userid",uid);
	    response.sendRedirect("innerpage.jsp");
	}else
        response.sendRedirect("index.jsp?message1=<font color=orange size=3>please enter valid details</font>");
	}catch(Exception e){e.printStackTrace();}
finally{
	try{
		if(rs3!=null)
			rs3.close();
		if(stmt3!=null)
			stmt3.close();
	}catch(Exception ee){ee.printStackTrace();}
}%>